var newscript = document.createElement('script');
newscript.setAttribute('type','text/javascript');
newscript.setAttribute('src','/aaa/layuiadmin/layui/layui.js');
var head = document.getElementsByTagName('head')[0];
head.appendChild(newscript);

layui.use(['layer', 'form'], function(){
    var layer = layui.layer
        ,form = layui.form;
});